3.8.32 \(\int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{(a+i a \tan (e+f x))^3} \, dx\) [732]

Optimal. Leaf size=59 \[ \frac {(A+i B) c}{3 a^3 f (i-\tan (e+f x))^3}-\frac {B c}{2 a^3 f (i-\tan (e+f x))^2} \]

[Out]

1/3*(A+I*B)*c/a^3/f/(I-tan(f*x+e))^3-1/2*B*c/a^3/f/(I-tan(f*x+e))^2

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45} \begin {gather*} \frac {c (A+i B)}{3 a^3 f (-\tan (e+f x)+i)^3}-\frac {B c}{2 a^3 f (-\tan (e+f x)+i)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x])^3,x]

[Out]

((A + I*B)*c)/(3*a^3*f*(I - Tan[e + f*x])^3) - (B*c)/(2*a^3*f*(I - Tan[e + f*x])^2)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {A+i B}{a^4 (-i+x)^4}+\frac {B}{a^4 (-i+x)^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(A+i B) c}{3 a^3 f (i-\tan (e+f x))^3}-\frac {B c}{2 a^3 f (i-\tan (e+f x))^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.60, size = 81, normalized size = 1.37 \begin {gather*} \frac {c \sec ^2(e+f x) (3 i A+2 (2 i A+B) \cos (2 (e+f x))-2 (A-2 i B) \sin (2 (e+f x))) (i+\tan (e+f x))}{24 a^3 f (-i+\tan (e+f x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x])^3,x]

[Out]

(c*Sec[e + f*x]^2*((3*I)*A + 2*((2*I)*A + B)*Cos[2*(e + f*x)] - 2*(A - (2*I)*B)*Sin[2*(e + f*x)])*(I + Tan[e +
 f*x]))/(24*a^3*f*(-I + Tan[e + f*x])^3)

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 43, normalized size = 0.73

method result size
derivativedivides \(\frac {c \left (-\frac {i B +A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) \(43\)
default \(\frac {c \left (-\frac {i B +A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) \(43\)
risch \(\frac {c \,{\mathrm e}^{-2 i \left (f x +e \right )} B}{8 a^{3} f}+\frac {i c \,{\mathrm e}^{-2 i \left (f x +e \right )} A}{8 a^{3} f}+\frac {i A c \,{\mathrm e}^{-4 i \left (f x +e \right )}}{8 a^{3} f}-\frac {c \,{\mathrm e}^{-6 i \left (f x +e \right )} B}{24 a^{3} f}+\frac {i c \,{\mathrm e}^{-6 i \left (f x +e \right )} A}{24 a^{3} f}\) \(100\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*c/a^3*(-1/3*(A+I*B)/(-I+tan(f*x+e))^3-1/2*B/(-I+tan(f*x+e))^2)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 5.19, size = 63, normalized size = 1.07 \begin {gather*} -\frac {{\left (3 \, {\left (-i \, A - B\right )} c e^{\left (4 i \, f x + 4 i \, e\right )} - 3 i \, A c e^{\left (2 i \, f x + 2 i \, e\right )} - {\left (i \, A - B\right )} c\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{24 \, a^{3} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/24*(3*(-I*A - B)*c*e^(4*I*f*x + 4*I*e) - 3*I*A*c*e^(2*I*f*x + 2*I*e) - (I*A - B)*c)*e^(-6*I*f*x - 6*I*e)/(a
^3*f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (44) = 88\).
time = 0.27, size = 206, normalized size = 3.49 \begin {gather*} \begin {cases} \frac {\left (192 i A a^{6} c f^{2} e^{8 i e} e^{- 4 i f x} + \left (64 i A a^{6} c f^{2} e^{6 i e} - 64 B a^{6} c f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (192 i A a^{6} c f^{2} e^{10 i e} + 192 B a^{6} c f^{2} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{1536 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\\frac {x \left (A c e^{4 i e} + 2 A c e^{2 i e} + A c - i B c e^{4 i e} + i B c\right ) e^{- 6 i e}}{4 a^{3}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e))**3,x)

[Out]

Piecewise(((192*I*A*a**6*c*f**2*exp(8*I*e)*exp(-4*I*f*x) + (64*I*A*a**6*c*f**2*exp(6*I*e) - 64*B*a**6*c*f**2*e
xp(6*I*e))*exp(-6*I*f*x) + (192*I*A*a**6*c*f**2*exp(10*I*e) + 192*B*a**6*c*f**2*exp(10*I*e))*exp(-2*I*f*x))*ex
p(-12*I*e)/(1536*a**9*f**3), Ne(a**9*f**3*exp(12*I*e), 0)), (x*(A*c*exp(4*I*e) + 2*A*c*exp(2*I*e) + A*c - I*B*
c*exp(4*I*e) + I*B*c)*exp(-6*I*e)/(4*a**3), True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (47) = 94\).
time = 0.77, size = 149, normalized size = 2.53 \begin {gather*} -\frac {2 \, {\left (3 \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 6 i \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3 \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 10 \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 i \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 6 i \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, a^{3} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e))^3,x, algorithm="giac")

[Out]

-2/3*(3*A*c*tan(1/2*f*x + 1/2*e)^5 - 6*I*A*c*tan(1/2*f*x + 1/2*e)^4 - 3*B*c*tan(1/2*f*x + 1/2*e)^4 - 10*A*c*ta
n(1/2*f*x + 1/2*e)^3 + 2*I*B*c*tan(1/2*f*x + 1/2*e)^3 + 6*I*A*c*tan(1/2*f*x + 1/2*e)^2 + 3*B*c*tan(1/2*f*x + 1
/2*e)^2 + 3*A*c*tan(1/2*f*x + 1/2*e))/(a^3*f*(tan(1/2*f*x + 1/2*e) - I)^6)

________________________________________________________________________________________

Mupad [B]
time = 8.84, size = 62, normalized size = 1.05 \begin {gather*} \frac {\frac {c\,\left (B+A\,2{}\mathrm {i}\right )}{6}+\frac {B\,c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{2}}{a^3\,f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i))/(a + a*tan(e + f*x)*1i)^3,x)

[Out]

((c*(A*2i + B))/6 + (B*c*tan(e + f*x)*1i)/2)/(a^3*f*(tan(e + f*x)*3i - 3*tan(e + f*x)^2 - tan(e + f*x)^3*1i +
1))

________________________________________________________________________________________